home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / PlayerPRO 4.5.8 / PlayerPRO 4.5.8 Dev.Kit / MADH Library 4.5 / Libraries & Headers / RDriver.h < prev    next >
Encoding:
Text File  |  1997-05-29  |  19.0 KB  |  549 lines  |  [TEXT/CWIE]

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 4.5x -- MAD Music Driver Definition -
  4. //
  5. //    Library Version 4.5
  6. //
  7. //    To use with MAD Library for Mac: Symantec, CodeWarrior and MPW
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //
  14. //    Thank you for your interest in PlayerPRO !
  15. //
  16. //    FAX:            (+41 22) 346 11 97
  17. //    PHONE:             (+41 79) 203 74 62
  18. //    Internet:         rosset@dial.eunet.ch or RossetAntoine@bluewin.ch
  19. //
  20. /********************                        ***********************/
  21.  
  22. #ifndef __RDRIVERH__
  23. #define __RDRIVERH__
  24.  
  25. #ifndef __MADH__
  26. #include "MAD.h"
  27. #endif
  28.  
  29. ////////////////////////////////////////////////
  30.  
  31. #ifdef _MAC_H
  32. #ifndef __SOUND__
  33. #include <Sound.h>
  34. #endif
  35.  
  36. #ifndef __RETRACE__
  37. #include <Retrace.h>
  38. #endif
  39. #endif
  40.  
  41. ////////////////////////////////////////////////
  42.  
  43. #ifdef _INTEL_H
  44. //static void debugger( char*a){MessageBox( GetForegroundWindow(), a, "PP", MB_OK | MB_ICONEXCLAMATION);}
  45.  
  46. #ifndef __DSOUND_INCLUDED__
  47. #include <mmreg.h>
  48. #include <DSound.h>
  49. #endif
  50. #endif
  51.  
  52. ////////////////////////////////////////////////
  53.  
  54. #if defined(powerc) || defined (__powerc)
  55. #pragma options align=mac68k
  56. #else
  57. #if !defined(THINK_C)
  58. #pragma options align=mac68k
  59. #endif
  60. #endif
  61.  
  62. ////////////////////////////////////////////////
  63.  
  64. /********************                        ***********************/
  65. /***                         Define List                            ***/
  66. /********************                        ***********************/
  67.  
  68. #define NUMBER_NOTES        96
  69. #define NOFINETUNE            8363
  70. #define MIN_VOLUME            0
  71. #define MAX_VOLUME            64
  72. #define MAXTRACK            32
  73. #define MAXINSTRU            64
  74. #define    MAXSAMPLE            25
  75. #define MAXPATTERN            200
  76. #define MAXPATTERNSIZE        900
  77. #define MAX_ARP             3
  78. #define MAXPLUG                40
  79. /********************                        ***********************/
  80. /***                         Error messages                         ***/
  81. /********************                        ***********************/
  82.  
  83. enum
  84. {
  85.     MADNeedMemory                     = -1,
  86.     MADReadingErr                    = -2,
  87.     MADIncompatibleFile                = -3,
  88.     MADLibraryNotInitialized        = -4,
  89.     MADParametersErr                = -5,
  90.     MADUnknowErr                    = -6,
  91.     MADSoundManagerErr                = -7,
  92.     MADOrderNotImplemented            = -8,
  93.     MADFileNotSupportedByThisPlug    = -9,
  94.     MADCannotFindPlug                = -10
  95. };
  96.  
  97. /********************                        ***********************/
  98. /***                Channel structure definition                    ***/
  99. /********************                        ***********************/
  100.  
  101. struct Channel
  102. {
  103.         long        ID;                    // Channel ID - 0 to 31
  104.  
  105.         Ptr            begPtr;                // Sample Data Ptr - Beginning of data
  106.         Ptr            maxPtr;                // Sample Data Ptr - End of data
  107.         Ptr            curPtr;                // Sample Data Ptr - Current position
  108.         long        sizePtr;            // Sample Size in bytes
  109.         
  110.         long        amp;                // Sample amplitude: 8 or 16 bits
  111.         
  112.         long        loopBeg;            // Loop Beginning
  113.         long        loopSize;            // Loop Size
  114.         
  115.         long        ins;                // Current Instrument ID
  116.         long        insOld;                // Previous Instrument ID played on this channel
  117.         long        samp;                // Current Sample ID
  118.         
  119.         long        fineTune;            // Finetune
  120.         
  121.         long        note;                // Note
  122.         long        noteOld;            // Previous note played on this channel
  123.         
  124.         long         period;                // Current period
  125.         long        periodOld;            // Previous period played on this channel
  126.         
  127.         long        vol;                // Channel vol (0 to 64)
  128.         long         cmd;                // Command
  129.         Byte        arg;                // Argument of command
  130.         Byte        volcmd;                // Volume Command
  131.         
  132.         long         arp[ MAX_ARP];        // Used for arpeggio command
  133.         long         arpindex;            // Used for arpeggio command
  134.         
  135.         long        viboffset;            // Used for vibrato command
  136.         long         vibdepth;            // Used for vibrato command
  137.         long         vibrate;            // Used for vibrato command
  138.         
  139.         long         slide;                // Used for slideUp and slideDown command
  140.         
  141.         long         pitchgoal;            // Used for portamento command
  142.         long         pitchrate;            // Used for portamento command
  143.         
  144.         long         volumerate;            // Used for slideVolume command
  145.         
  146.         long        oldArg[ 16];
  147.  
  148.         Ptr            samplePtr;            // Used internaly by MADPlaySoundData & MADPlaySndHandle
  149.         
  150.         /**/
  151.         
  152.         Boolean        KeyOn;
  153.         short        a;
  154.         short        b;
  155.         short        p;
  156.         long        volEnv;
  157.         long        volFade;
  158.         
  159.         long        lAC;
  160.         
  161.         Ptr            prevPtr;
  162.         long        lastWord, curLastWord;
  163.         long        curLevel;
  164.         
  165.         long        prevVol, curPrevVol;
  166.         
  167.         /**/
  168.         
  169.         Boolean        GEffect;
  170.         short        GPat, GReader;
  171. };
  172. typedef        struct Channel    Channel;
  173.  
  174. /********************                        ***********************/
  175. /***         Music description - used in Import/Export filter    ***/
  176. /********************                        ***********************/
  177.  
  178. struct    MADPartition
  179. {
  180.     MADSpec                    *header;                                // Music Header - See 'MAD.h'
  181.     PatData                    *partition[ MAXPATTERN];                // Patterns
  182.     sData                        *(sample[ MAXINSTRU][ MAXSAMPLE]);        // Instruments
  183. };
  184. typedef        struct MADPartition    MADPartition;
  185.  
  186. /********************                        ***********************/
  187. /***                  Driver Settings definition                    ***/
  188. /********************                        ***********************/
  189.  
  190. enum
  191. {
  192.     ASCSoundDriver = 1,                // MAC ONLY
  193.     AWACSoundDriver,                // MAC ONLY
  194.     MIDISoundDriver,                // MAC ONLY
  195.     SoundManagerDriver,                // MAC ONLY You should use only SoundManagerDriver for full compatibility !
  196.     QK25SoundDriver,                // MAC ONLY
  197.     DigiDesignSoundDriver,            // MAC ONLY
  198.     BeOSSoundDriver,                // BE ONLY when using with BeOS compatible systems ! - NOT FOR MAC
  199.     DirectSound95NT,                // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  200.     Wave95NT,                        // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  201.     NoHardwareDriver                // NO HARDWARE CONNECTION, will not produce any sound
  202. };
  203.  
  204. enum
  205. {
  206.     MonoOutPut = 1,
  207.     StereoOutPut,
  208.     DeluxeStereoOutPut,
  209.     PolyPhonic                        // Do NOT use it ! Standard hardware doesn't support it !
  210. };
  211.  
  212. struct MADDriverSettings
  213. {
  214.     short                    numChn;                                // Active tracks from 2 to 32, automatically setup when a new music is loaded
  215.     short                    outPutBits;                            // 8 or 16 Bits
  216.     unsigned long            outPutRate;                            // Fixed number, by example : rate44khz, rate22050hz, rate22khz, rate11khz, rate11025hz
  217.     short                    outPutMode;                            // MonoOutPut, StereoOutPut or DeluxeStereoOutPut ?
  218.     short                    driverMode;                            // ASCSoundDriver, AWACSoundDriver, MIDISoundDriver or SoundManagerDriver
  219.     Boolean                    antiAliasing;                        // Use AntiAliasing filter ? true/false
  220.     Boolean                    repeatMusic;                        // If music finished, repeat it or stop.
  221.     Boolean                    sysMemory;                            // Allocate memory in Application Heap (false) or in System Heap (true)
  222.     Boolean                    Interpolation;                        // Sound Interpolation active? true/false
  223.     Boolean                    MicroDelay;                            // Micro delay active? Used only in DeluxeStereoOutPut outPutMode.
  224.     long                    MicroDelaySize;                        // Micro delay duration (in ms, max 1 sec = 1000 ms)
  225.     Boolean                    surround;                            // Surround effect active? true/false
  226.     Boolean                    Reverb;                                // Reverb effect active? true/false
  227.     long                    ReverbSize;                            // Reverb delay duration (in ms, min = 25 ms, max 1 sec = 1000 ms)
  228.     long                    ReverbStrength;                        // Reverb strength in % (0 <-> 70)
  229.     Boolean                    TickRemover;                        // Remove volume/sample/loop ticks.
  230. };
  231. typedef struct MADDriverSettings MADDriverSettings;
  232.  
  233. /******************************************************************/
  234. //******************* MUSICS IMPORT/EXPORT PLUGS  *****************/
  235. //
  236. //    Protocol Version 2.3
  237. //
  238. //    To use with PlayerPRO for CodeWarrior
  239. //
  240. //    Your main function have to be in this form:
  241. //    OSErr main(     OSType order,
  242. //                    Ptr AlienFileName,
  243. //                    MADPartition *MadFile,
  244. //                    PPInfoRec *info,
  245. //                    MADDriverSettings *DriverParam);
  246. //
  247. //    Actual plug have to support these orders:
  248. //
  249. //    order: 'TEST':    check the AlienFile to see if your Plug really supports it.
  250. //    order: 'IMPT':    convert the AlienFile into a MADPartition. You have to allocate MADPartition.
  251. //    order: 'INFO':    Fill PPInfoRec structure.
  252. //    order: 'EXPT':    Convert the MADPartition into AlienFile. You have to create the AlienFile.
  253. //                    Don't delete the MADPartition Structure after conversion !!
  254. //
  255. //    An IMPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO'
  256. //    An EXPORT plug have to support these orders: 'EXPT'
  257. //     An IMPORT/EXPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO', 'EXPT'
  258. //
  259. //    About Resources:
  260. //
  261. //    Your Plug should have: Creator: 'SNPL', Type: 'IMPL' - MAC ONLY
  262. //
  263. //    Your Plug have to have these resources - MAC ONLY:
  264. //
  265. //    - One segment CODE 1000 with 68k Code
  266. //    - One segment PPCC 1000 with PPC Code (OPTIONAL: if PlayerPRO in PPC cannot find it, it will use the CODE 1000 resource)
  267. //    - One STR# resource :
  268. //
  269. //        1 string: which kind of files your plug support (OSType value!!! 4 char) By example: 'STrk', '669 ', etc...
  270. //        2 string: what does your Plug: EXPL : only Export files, IMPL : only Import Files, EXIM : import AND export.
  271. //        3 string: string that will be used in Import and Export menu of PlayerPRO
  272. //        4 string: Copyright string of this plug.
  273. //
  274. /********************                        ***********************/
  275.  
  276. struct PPInfoRec
  277. {
  278.     char        internalFileName[ 60];
  279.     char        formatDescription[ 60];
  280.     
  281.     long        totalPatterns;
  282.     long        partitionLength;
  283.     
  284.     short        totalTracks;
  285.     short        totalInstruments;
  286.     
  287.     OSType        signature;
  288.     
  289.     long        fileSize;
  290.     
  291. };
  292. typedef struct PPInfoRec PPInfoRec;
  293.  
  294.  
  295. /********************                        ***********************/
  296. /***             Informations about Plugs: ThePlug[]                ***/
  297. /********************                        ***********************/
  298.  
  299. #ifdef _MAC_H
  300. struct PlugInfo
  301. {
  302.     Handle        IOPlug;                                            // Plug CODE
  303.     Str63        MenuName;                                        // Plug name
  304.     Str63        AuthorString;                                    // Plug author
  305.     FSSpec        file;                                            // Location of plug file
  306.     char        type[ 5];                                        // OSType of file support
  307.     OSType        mode;                                            // Mode support : Import +/ Export
  308.     Boolean        hasPPCCode;                                        // Is Plug FAT?
  309. };
  310. typedef struct PlugInfo PlugInfo;
  311. #endif
  312.  
  313. #ifdef _INTEL_H
  314. //#include "windows.h"
  315. typedef OSErr (*PLUGDLLFUNC) ( OSType , Ptr , MADPartition *, PPInfoRec *, MADDriverSettings *);
  316. struct PlugInfo
  317. {
  318.     HANDLE            hLibrary;
  319.     PLUGDLLFUNC        IOPlug;                                        // Plug CODE
  320.     char            MenuName[ 65];                                // Plug name
  321.     char            AuthorString[ 65];                            // Plug author
  322.     char            file[ 255];                                    // Location of plug file
  323.     char            type[ 5];                                    // OSType of file support
  324.     OSType            mode;                                        // Mode support : Import +/ Export
  325. };
  326. typedef struct PlugInfo PlugInfo;
  327. #endif
  328.  
  329. #ifdef _BE_H
  330. struct PlugInfo
  331. {
  332.     Handle            hLibrary;
  333.     Ptr                IOPlug;                                        // Plug CODE
  334.     char            MenuName[ 65];                                // Plug name
  335.     char            AuthorString[ 65];                            // Plug author
  336.     char            file[ 255];                                    // Location of plug file
  337.     char            type[ 5];                                    // OSType of file support
  338.     OSType            mode;                                        // Mode support : Import +/ Export
  339. };
  340. typedef struct PlugInfo PlugInfo;
  341. #endif
  342. /********************                        ***********************/
  343. /***         Global structure : PlayerPRO variables                ***/
  344. /********************                        ***********************/
  345.  
  346. #ifdef _MAC_H                        // For ASC support on 68k Macintoshes
  347. struct inVBLRec
  348. {
  349.     VBLTask            VBL;
  350.     long            VBLA5;
  351. };
  352. typedef struct inVBLRec inVBLRec;
  353. #endif
  354.  
  355. struct MADDriverRec
  356. {
  357.     long                    IDType;                                            // IDType = 'MADD' -- READ ONLY --
  358.     
  359.     /**********************/
  360.     /** Public variables **/
  361.     /**********************/
  362.     
  363.     MADDriverSettings        DriverSettings;                                    // Driver SetUp -- READ ONLY --
  364.     
  365.     /**  Current music in memory, loaded with RLoadMusic() by example **/
  366.     
  367.     MADSpec                    *header;                                        // MAD Header  -- READ ONLY --
  368.     PatData                    *partition[ MAXPATTERN];                        // Patterns    -- READ ONLY --
  369.     sData                        *(sample[ MAXINSTRU][ MAXSAMPLE]);            // Instruments -- READ ONLY --
  370.     
  371.     /**  Drivers variables **/
  372.     
  373.     Channel                    chan[ MAXTRACK];                                // Current driver channels -- READ ONLY --
  374.     Boolean                    musicEnd;                                        // Is music playing finished? -- READ ONLY --
  375.     short                    Tube[ MAXTRACK];                                // Used in 'Tracks View' Window - View menu 
  376.     short                    PartitionReader;                                // Current position in pattern (0...64)
  377.     short                    Pat;                                            // Current ID Pattern, see 'Patterns list'
  378.     short                    PL;                                                // Current position in partition, see 'Partition list'
  379.     long                    VolExt[ MAXTRACK];                                // Volumes settings for each track, see 'Adaptators' window. from 0 to 64
  380.     long                    VolGlobal;                                        // Global SOFTWARE volume (This is NOT Mac hardware volume!) from 0 to 64
  381.     short                    speed;                                            // Current speed, see speed Effect
  382.     short                    finespeed;                                        // Current finespeed, see speed Effect
  383.     short                    InstruTube[ MAXINSTRU];                            // Used in 'Instrument View' Window - View menu
  384.     short                    VExt;                                            // External music speed, see 'Adaptators' window. 80 = normal
  385.     short                    FreqExt;                                        // External music pitch, see 'Adaptators' window. 80 = normal
  386.     Boolean                    Reading;                                        // Reading indicator
  387.     short                    LeftRight[ MAXTRACK];                            // Left/Right % for Deluxe Driver
  388.  
  389.     #ifdef _MAC_H
  390.     SndChannelPtr             MusicChannelPP;                                    // The SndChannelPtr to apply SndDoCommand, etc.
  391.     #endif                                                                    // ONLY available if you are using MAC SoundManager driver
  392.     
  393.     #ifdef _INTEL_H
  394.     LPDIRECTSOUND            lpDirectSound;                                    // The LPDIRECTSOUND to apply & get informations, etc.
  395.     LPDIRECTSOUNDBUFFER        lpDirectSoundBuffer, lpSwSamp;                    // ONLY available if you are using Win95 DirectSound driver
  396.     #endif
  397.     
  398.     /** Plugs Import/Export variables **/
  399.  
  400.     PlugInfo                 *ThePlug;                            // Pointers on plugs code & infos
  401.     short                    TotalPlug;                            // no of Plugs in pointer ThePlug
  402.     
  403.  
  404.     /** Private variables - Not documented **/
  405.     /* DO NOT MODIFY OR USE these variables */
  406.  
  407.     long                    MIN_PITCH, MAX_PITCH;
  408.     short                    smallcounter, trackDiv;
  409.     long                    FREQBASE;
  410.     short                    InstruActif[ MAXINSTRU];
  411.     Ptr                        SysHeapPtr, Vol, IntDataPtr, OscilloWavePtr;
  412.     Boolean                    JumpToNextPattern, endPattern, MADPlay;
  413.     long                    ASCBUFFER;
  414.     long                    BufSize;
  415.     long                    VSYNC, BufCounter, BytesToGenerate;
  416.     short                    vibrato_table[ 64];
  417.     short                    MIDIPortRefNum, gOutNodeRefNum;
  418.     short                    InstuNoOld[ MAXTRACK];
  419.     short                    NoteOld[ MAXTRACK];
  420.     short                    VelocityOld[ MAXTRACK];
  421.     Boolean                    TrackLineReading[ MAXTRACK];
  422.     Ptr                        OverShoot;
  423.     long                    *DASCBuffer;
  424.     short                    *DASCBuffer8;
  425.     long                    mytab[ 12];
  426.     long                    MDelay;
  427.     long                    RDelay;
  428.     Ptr                        ReverbPtr;
  429.     
  430.     #ifdef _MAC_H
  431.     SndDoubleBufferHeader     TheHeader;
  432.     SndChannelPtr             pseudoChanAWAC;
  433.     inVBLRec                VBL;
  434.     #endif
  435. };
  436. typedef struct MADDriverRec MADDriverRec;
  437.  
  438. /********************                        ***********************/
  439. /***                        EFFECTS ID                            ***/
  440. /********************                        ***********************/
  441.  
  442. enum {
  443.         arpeggioE         = 0,    //    0x00
  444.         downslideE         = 1,    //    0x01
  445.         upslideE         = 2,    //    0x02
  446.         portamentoE     = 3,    //    0x03
  447.         vibratoE         = 4,    //    0x04
  448.         portaslideE     = 5,    //    0x05
  449.         vibratoslideE    = 6,    //    0x06
  450.         nothingE         = 7,    //    0x07
  451.         offsetE         = 9,    //    0x08
  452.         slidevolE         = 10,    //    0x0A
  453.         fastskipE         = 11,    //    0x0B
  454.         volumeE         = 12,    //    0x0C
  455.         skipE             = 13,    //    0x0D
  456.         extendedE         = 14,    //    0x0E
  457.         speedE             = 15    //    0x0F
  458.     };
  459.  
  460. /********************                        ***********************/
  461. /***                        FUNCTIONS                            ***/
  462. /********************                        ***********************/
  463.  
  464.  
  465. #ifdef __cplusplus
  466. extern "C" {
  467. #endif
  468.  
  469. MADDriverRec* MADGetMADDriverPtr();                                    // Get MADDriver structure pointer.
  470.  
  471. OSErr    MADInitLibrary( char *PlugsFolderName, Boolean SysMemory);    // Library initialisation, you have to CALL this function if you want to use other functions & variables
  472. OSErr    MADDisposeLibrary( void);                                    // Close Library, close music, close driver, free all memory
  473.  
  474. void    MADGetBestDriver( MADDriverSettings    *DriverInitParam);        // Found and identify the current Mac sound hardware and fill DriverInitParam
  475. OSErr    MADCreateDriver( MADDriverSettings    *DriverInitParam);        // Music Driver initialization and memory allocation
  476. OSErr    MADDisposeDriver();                                            // Dispose the music driver, use it after RInitMusic()
  477.  
  478. OSErr    MADStartDriver( void);                                        // NEW - Activate the sound generating procedure (interruption)
  479. OSErr    MADStopDriver( void);                                        // NEW - DESActivate the sound generating procedure (interruption)
  480.  
  481. OSErr    MADPlayMusic();                                                // NEW - Read and play current music in memory - Call MADStartInterruption BEFORE
  482. OSErr    MADStopMusic();                                                // NEW - Stop reading current music in memory
  483.  
  484. OSErr    MADReset( void);                                            // Reset the current music at the start position
  485. OSErr    MADGetMusicStatus( long *fullTime, long *curTime);            // Get informations about music position and duration, IN 1/60th SECS !! NOT IN SECS ANYMORE !!!!!!!
  486. OSErr    MADSetMusicStatus( long minV, long maxV, long curV);        // Change position of current music, by example MADSetMusicStatus( 0, 100, 50) = go to the middle of the music
  487.  
  488. OSErr    MADSetHardwareVolume( long);                                // 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  489. long    MADGetHardwareVolume();                                        // Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  490.  
  491. OSErr    MADLoadMusicRsrc( OSType IDName, short IDNo);                // MADH ONLY - Load a MAD Rsrc into memory
  492. OSErr    MADLoadMusicPtr( Ptr myPtr);                                // MADH ONLY - Load a MAD Ptr into memory, you can DisposPtr your Ptr after this call
  493. OSErr    MADLoadMusicPartition( MADPartition *aPartition);            // MADH ONLY - Load a MAD partition into memory
  494.  
  495. OSErr    MADLoadMusicFilePString( char *type, Str255 fName);            // Load a music file with plugs
  496. OSErr    MADLoadMusicFileCString( char *type, Ptr fName);            // Load a music file with plugs
  497. OSErr    MADLoadMusicFSpFile( char *type, FSSpec *theSpec);            // Load a music file with plugs
  498.  
  499. OSErr    MADMusicIdentifyPString( char *type, Str255 pName);            // Identify what kind of music format is pName file.
  500. OSErr    MADMusicIdentifyCString( char *type, Ptr cName);            // Identify what kind of music format is cName file.
  501. OSErr    MADMusicIdentifyFSp( char *type, FSSpec *theSpec);            // Identify what kind of music format is theSpec file.
  502.  
  503. Boolean    MADPlugAvailable( char *type);                                // Is plug 'type' available?
  504.  
  505. OSErr    MADDisposeMusic(void);                                        // Dispose the current music, use it after RLoadMusic(), RLoadMusicRsrc(), RInstallMADF()
  506.  
  507. void    MADChangeTracks( short);                                    // Change current tracks number of the music driver
  508. void    MADCleanDriver( MADDriverRec *intDriver);                    // Clean the driver : stop playing sounds
  509. Cmd*    GetMADCommand(    short        position,                        // Extract a Command from a PatData structure
  510.                         short        channel,
  511.                         PatData*    aPatData);
  512.  
  513. OSErr    MADPlaySndHandle(     Handle sound,                            // Handle to a 'snd ' handle, by ex: GetResource('snd ', 128);
  514.                             long chan,                                // channel ID on which to play sound
  515.                             long note);                                // note: 0 to NUMBER_NOTES or 0xFF: play sound at his normal sampleRate Khz
  516.  
  517. OSErr    MADPlaySoundData(    Ptr                soundPtr,                // Sound Pointer to data
  518.                             long            size,                    // Sound size in bytes
  519.                             long            channel,                // channel ID on which to play sound
  520.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  521.                             long            amplitude,                // 8 or 16 bits
  522.                             long            loopBeg,                // loop beginning
  523.                             long            loopSize,                // loop size in bytes
  524.                             unsigned long    rate);                    // sample rate of the sound data, by ex: rate22khz
  525.  
  526. OSErr    MADPlaySoundDataSYNC(Ptr            soundPtr,                // Sound Pointer to data
  527.                             long            size,                    // Sound size in bytes
  528.                             long            channel,                // channel ID on which to play sound
  529.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  530.                             long            amplitude,                // 8 or 16 bits
  531.                             long            loopBeg,                // loop beginning
  532.                             long            loopSize,                // loop size in bytes
  533.                             unsigned long    rate);                    // sample rate of the sound data, by ex: rate22khz
  534.  
  535. Ptr MADNewPtr( long size, MADDriverSettings* init);
  536. Ptr MADNewPtrClear( long size, MADDriverSettings* init);
  537.  
  538. #ifdef __cplusplus
  539. }
  540. #endif
  541.  
  542. #if defined(powerc) || defined (__powerc)
  543. #pragma options align=reset
  544. #else
  545. #if !defined(THINK_C)
  546. #pragma options align=reset
  547. #endif
  548. #endif
  549. #endif